import req  from '@/utils/request';



enum API {
    PRODUCT_PAGE_QUERY = '/product/brade/page-query',
    PRODUCT_DETAIL = '/product/brade/detail',
    PRODUCT_SAVE = '/product/brade/save',
    PRODUCT_DELETE = '/product/brade/delete',
}


export const pageQueryApi = (pageNum: number,pageSize: number) => {
    
    return req.get(API.PRODUCT_PAGE_QUERY + `?pageNum=${pageNum}&pageSize=${pageSize}`);
}

export const productDetailApi = (id: number) => {
    return req.get(API.PRODUCT_DETAIL, { params: { id } });
}   

export const productSaveApi = (data: any) => {
    return req.post(API.PRODUCT_SAVE, data);
}   

export const productDeleteApi = (id: number) => {
    return req.post(API.PRODUCT_DELETE, { id });
}   

